Fix #3094 (2.2-stable branch)