Fixed split function