fixed some unsigned int issues

oh, I know.  It just makes me twitch to assign -1 to an unsigned int, so I figured as long as I'm fixing stuff... :)