Fixes suggested by @annevk