Fixing #6 and #3