replaced some int by int32_t