Added unit test for Error class and improved it.