Fix #694, take 2

@garyb @joneshf Another go at #694.