Fix a bug found by Massimiliano Cialdi: