Fixed #5 and #6

Please pull to fix #5 and #6