fixes and closes #87 thanks to @stinkstiefel