fixed a bunch of signed/unsigned warnings (and actually bugs waiting to happen!)