Fixed a bug with registering Errors.

When registering an error multiple times, previously the `init` function on the
error would be deleted, leading to a wrong error message being loaded. This has
been fixed.