Tweaked the error macros.
Refactored the error checking in bit coder.