Improve the detection of invalid includes by moving the test outside the