Added more log messages and support for error pages