LLVM-related fixes

Resolves breakage introduced by c7cf1f0f and fixes/polishes a few other things.