Fix for issue #1285
Merge pull request #1292 from mortenn/master

 Fix for issue #1285