Fix regression from issue 3312