Fixing handling of profile from config file