Better handling on page load. Bug fixes.