Extra space for numbered titles in table of contents

For me, tocstyle produces correct horizontal spacing with both standard and KOMA-script classes. Try to compile my example with three or even four LaTeX runs -- maybe the makefile you use doesn't recognize that tocstyle needs yet another LaTeX run to calculate the ToC spacing.

\documentclass{scrreprt}

\usepackage{tocstyle}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\begin{document}

\tableofcontents

\setcounter{chapter}{100}
\chapter{bla}
\setcounter{section}{200}
\section{blubb}
\setcounter{subsection}{300}
\subsection{foo}
\setcounter{subsubsection}{400}
\subsubsection{bar}

Some text.

\end{document}

Current KOMA-Script release provides options tocindent and tocnumwidth for \RedeclareSectionCommand that allows to change the indent and the space reserved for the entry number without breaking any feature of the KOMA-Script classes.

\documentclass{scrbook}

\RedeclareSectionCommand[tocnumwidth=2.6em]{section}
\RedeclareSectionCommand[tocindent=4.1em,tocnumwidth=3.5em]{subsection}

\begin{document}
\tableofcontents
% Only some dummy test code:
\clearpage
\setcounter{chapter}{15}
\setcounter{section}{9}
\section{Classes}
\subsection{Abstract}
\subsection{Concrete}
\subsection{Exception}
\section{Automation}
\section{Summary}
\end{document}

e.g., would result in:

enter image description here