Better array allocation in split_indices
Fixes #131