Fixes #637

See bugreport #637