Applying fix for issue #46 on 1.1 branch