Fixed some environment variable problems with dylibs