Bugfix for issue-508