Fixes of previous commit, as proposed by Nicholas Francois.