Cleanup, bug fixes for duplicate page load