fixes #34 fixes #38 fixes #41 fixes #39