improve error messages and console output