More clean up, proper logging of errors