Tidied up pagination bugs.