Also fix some inconsistencies between the different scan loops:
- Increment pdpages for every page encountered in the scan, including markers. Markers should not be common enough that this makes a difference.
- Leave newlines around the assertions to make the code a bit easier to see.
- Remove some unhelpful comments.