Removed problem with flush() not being called
Improved fatal errors handling