Made the exceptions extends the right abstract class.