Fixed issues #13 and #16