Changes to fix issue #46