Fix stupid mistake in isValidEnv.
Hook up QuickCheck test.