fixes #147 fixes #146 fixes #140 fixes #137