Corrected placement of typedefs used by macros, and brought them to use in all macros