Updated exception handling to have more specific error messages to the user.