Minor bug fixes to pagination