Tentative fix for bug #55. Thanks to ggn for reporting!