Fixed bug when loading with environmental variables