Updated error codes to real, native Error instances.