Fix error reporting
Allow user versions of primitive encoders to override the default ones