Rewrite of the error encoding specs