Fixed a bug with split function