fixes suggested by @jarv