Improved error reporting. Text now is colored red when an error is detected, and stacktrace is now printed to the log.