fixes suggested by nickm