issue #861 partial fix