Fixes bug 551
Merge pull request #562
merge #562

Thanks @mtraynham!