Fixes #28 #29 #42