Fix two minor bugs reported by jvoisin