Fixed bug for missing page title. Code cleanup.