Fixed a missing 'else()' from macros.cmake and used unset instead of set when clearing variables.