Fix errors when deleting a page and apply coding standard.

#6155