Fixes broken pagination for blocked IP addresses

As well as some general code cleanup I noticed