Correct page counting
Remove debug code