Fix #1161
Merge pull request #1162 from xerora/1161-fix

Fix #1161