fixes #169 fixes #171