more environment variation, a few minor fixes