Fixed #7 and #6 issues