Fixes suggested by Patrick