Issue #5 and Issue #6 fix