Friends, I'm stuck with a funny error: when I add multiple indices in my table of contents, all page number references mess up. It's probably something easy to solve, but I can't figure out what it is.
Consider this non-so-minimum example (sorry, I had no choice):
\documentclass[twoside]{book}
\usepackage{idxlayout}
\usepackage[useindex]{splitidx}
\makeindex
\newindex[Index A]{ia}
\newindex[Index B]{ib}
\newindex[Index C]{ic}
\newindex[Index D]{id}
\newcommand*\indexall[1]{%
\sindex[ia]{#1}%
\sindex[ia]{#1#1}%
\sindex[ia]{#1#1#1}%
\sindex[ia]{#1#1#1#1}%
\sindex[ia]{#1#1#1#1#1}%
\sindex[ia]{#1#1#1#1#1#1}%
\sindex[ia]{#1#1#1#1#1#1#1}%
\sindex[ia]{#1#1#1#1#1#1#1#1}%
\sindex[ib]{#1}%
\sindex[ib]{#1#1}%
\sindex[ib]{#1#1#1}%
\sindex[ib]{#1#1#1#1}%
\sindex[ib]{#1#1#1#1#1}%
\sindex[ib]{#1#1#1#1#1#1}%
\sindex[ib]{#1#1#1#1#1#1#1}%
\sindex[ib]{#1#1#1#1#1#1#1#1}%
\sindex[ic]{#1}%
\sindex[ic]{#1#1}%
\sindex[ic]{#1#1#1}%
\sindex[ic]{#1#1#1#1}%
\sindex[ic]{#1#1#1#1#1}%
\sindex[ic]{#1#1#1#1#1#1}%
\sindex[ic]{#1#1#1#1#1#1#1}%
\sindex[ic]{#1#1#1#1#1#1#1#1}%
\sindex[id]{#1}%
\sindex[id]{#1#1}%
\sindex[id]{#1#1#1}%
\sindex[id]{#1#1#1#1}%
\sindex[id]{#1#1#1#1#1}%
\sindex[id]{#1#1#1#1#1#1}%
\sindex[id]{#1#1#1#1#1#1#1}%
\sindex[id]{#1#1#1#1#1#1#1#1}}%
\begin{document}
\tableofcontents
\chapter{My text}
Hello world.
\indexall{A}
\indexall{B}
\indexall{C}
\indexall{D}
\indexall{E}
\indexall{F}
\indexall{G}
\indexall{H}
\indexall{I}
\indexall{J}
\indexall{K}
\indexall{L}
\indexall{M}
\indexall{N}
\indexall{O}
\indexall{P}
\indexall{Q}
\indexall{R}
\indexall{S}
\indexall{T}
\indexall{U}
\indexall{V}
\indexall{W}
\indexall{X}
\indexall{Y}
\indexall{Z}
\addcontentsline{toc}{chapter}{Index A}
\printindex[ia]
\addcontentsline{toc}{chapter}{Index B}
\printindex[ib]
\addcontentsline{toc}{chapter}{Index C}
\printindex[ic]
\addcontentsline{toc}{chapter}{Index D}
\printindex[id]
\end{document}
(every time you run this code, a kitten dies)
The generated table of contents is as follows:

At least, this time I got odd numbers in my ToC. The previous attempt raised even numbers (!).
The correct reference should be:
Index A - 5
Index B - 9
Index C - 13
Index D - 17
If I put \cleardoublepage before the indices, I get this ToC (the first index is fixed):

I really can't understand what's going on. I can't even establish a pattern.
Does anyone have a suggestion?
(no animals were harmed in the making of this question)