fixed some warnings (unused variables, signed-unsigned comparison)