making LLVM happy by fixing some bugs