Fix a few issues in prep for pagination