Improved handling of adding new profiles.