Moved type defs out of macros (Thanks to Andre Martins!).