Improved error handling, console output.