Added MAS prefix to macros, other formatting changes