changed error messages to refer to corresponding case, fixed typos