Add test for to/from binary error macros, fix broken macro