Fix ISSUE #2 and ISSUE #3