Fix bug reported by Ignacio Monge García