Fix long int VS int type mismatch