Minor cleanup in page flipping code