Fixing issue #4 and #9