Bugfix for #562