Fix some clang warnings about type conversions