various changes regarding error handling (formatted)