Bugfix for #1850