Fix for #1122
Merge pull request #1155 from xerora/1122-fix

Fix for #1122