Replaced macros with enums and fixed build