Backport fix made in changeset 3455 from http://cpc.regardscitoyens.org/