CGE: Fix formatting in extract_cge.cpp.
CGE: Use defines instead of hardcoded values.

Also fix the formatting of the already present defines.
CGE: Fix missing file closings when an error happens.