Tentative fix for issue #54.

Cannot reproduce the bug, this should fix it anyway.