fix problems with environment switching during debugging sessions