Added a check to see if the database is active in page_alter().