Fix overflow (thanks jvoisin)