Bug fix from Sylvain