Fix mismatching #if #endif in include.hpp.

Also, add a unit test to make sure this does not happen again.