Fixing issues with environment and config parsing