Hackish (but working) fix for issue #17