fixed errors noticed by Stephane Galles