fixed a 64 bit bug that could cause a crash and removed warnings