Revert "Revert "prima: Reapply fixes after upgrade to 3.2.2.2""

This reverts commit f59d5877cf244e174f0fe7ff61dd534d96bfd343.