Fixed next/previous and test for special case