Merge changes Ifafafcd6,I5802dedc into main

* changes:
  Fix incorrect nullability annotations
  Add helper method to enfore a package name belongs to an uid