Cleanup: Improve general exception handling.
WIP: Try to improve stream handling