Fixes suggested by Michael Koziarski