Added a unit test & finalized error register class