Fixes issues #97 and #99 from github