Fix a couple of flaws spotted by the analyser.