CGE: Fix check on file handlers