Merge Florent Gluck's changes back to upstream