Fix a bug or two from merged KotH changes