Fix next keyword patterns behavior