Some fixes for my accidental merge of #970.