Use int instead of uint32_t, and fix compilatino