fix splitting path by extension

fixes issue #5