Fixed bug in environments