Fixed issue #7 and issue #8