Four macros changed to static inline type functions and style fixes