Fixing bug in split() call