prima: Copied 3.2.2.17 ver. from gproj kernel