fixed some warnings

* fixed a couple unused variable warnings
* fixed several more serious "< of unsigned value always returns false" warnings, that prevented the corrupt particle packet guard code from properly working