FIX using uint16_t instead of int16_t
FIX seg fault on 32bits sytems