Added test for isValid.

Related to issue #84.