Fixed some environment issues