Implemented invalid value exception. Relates to #1.