Fix remove-defines, use cli arguments
Various fixes