Added a missing assert in split_spaces