Fixed page count bug