Fix page selector logic.