fixed warnings about signed-unsigned comparison and some other