Improve ErrorStateRegistry
Closes #10