fixes #741
fixes #697
fixes #664