Fix splitLookup and split.

Fix wrong implementation and tests as observed by kgeorgiy.