Changed #define to use macros, fixed edge case for inline macros