Fix issue 96

This PR works for me, but has had only minimal testing.