Fixed issues #26 and #23