Fixed some minor warnings/bugs

no longer comparing signed and unsigned ints