Better error handling in CGFX.