Fix for 1271

--HG--
extra : source : 0b83356d20d4cf6ec4dc8a63796610319c44d66e
Changelog entry for bug 1271

--HG--
extra : source : b1f7f982576105f084c591f195c1d979a7fcadc7
Merge pull request #522 from einhverfr/master

fix for 1271