Added MACHINE option to standalone.cmake and fixed some bugs.