Fixed issues spotted by @mjallday