improve environment checks, closes #16