Bugfix for #2704