Fix #501 with the code from @Borkason
Merge pull request #1044 from cherokee/fix-501-split

Fix #501 with the code from @Borkason