numerous small bytecode-generation fixes