Renamed some macros more appropriately. Also improved my error handling so it's slightly useful.