Add range checks for splits; fix up comments for clarity