Remove useless CMake directives, fix problems with 'auto'