Bugfix for #519