Improved error handling:
 - setattr referencing a declared env not in the list of valid envs lead to weird error
Added test: Setattr referencing a declared group with env not in the list of valid envs