issue #898 some fixes