fixes suggested by Chris Jones