fix several pagination errors