Fix compiler warnings about type mismatch