Restoring some code to sig_pri. Not sure if it is really needed.