Merged from envhandling branch