Fixed sign extension bugs in previous commit.  They didn't completely break scheduling because negative priorities were most fixed up by converting kg_pri_user back to the correct type.
Fixed sign extension bugs in previous commit.  They didn't completely
break scheduling because negative priorities were most fixed up by
converting kg_pri_user back to the correct type.

Fixed some style bugs in previous commit (non-terminated sentence fragments
and regressions in comments).

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase