Fixed a patch (strange) with some missing #endif and updated def config