Fixes suggested by @seratch