Improved error handling by TDD

Improved the handling of various errors by TDD. Removed the error window
and made a log message instead.