Work around LLVM bug in #41
Some minor code movement and a helpful error