Fix warnings about type conversion