Moved an exception class to the core project.
Added missing `@Overrides`s.
Some code reorganization.