Fixed settings load order

Fixed loading settings before setting environment variable pointing to settings