bugfix: flags need to be set even if upgrade is not used
bugfix: flags should be inherited from parent