Partial fix for broken code that was merged from upstream, from pull
request #15.