Fixed issues #4 and #9