Fixed pagination issues