More error management and logging to standard output