Some improvements for the fix for issue #107