Fix Page class validate method. Fix some code styling.