Possible fix for issue #73. Needs testing.