More fixes to prim procs.
Fixed merge conflicts.