Removed generation of invalid values and did some cleanup.