Added an exception when invalid case.
Fixes after code review.