tests and corrected error in envSample