Fixed issues #9 and #7