Fix problems spotted by @bruno-