Fixed some warnings

Removed unused variables and fixed signed/unsigned comparation warnings