Added new exception, ValueException.

Also, getElement() and getElements() have been secured.