fixes #259
fixes #214
minor fixes
fixes #268
fixes #164