Fixes #149 fixes #142