Fix for #1810

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Tests pass: yes
Fixes tickets:1810
References: 1810
License of the code: LGPLv3+
Documentation PR: 
Todo: