Fixing bailout on error conditions