Issue #1 and issue #2 fixed