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

This reverts commit 3a48e9b57a84f801a891dde29f7a9d4509351004.