Fixed issues #57 and #59