Here is a fix for issue #12