Added error handling and HTML 5 URL history.