Fixed issues #8 and #9