Fixed procflag calculations