fixes #861