fixes to make this branch compatible with llvm versions before 3.4