fixes #817
fixes #819
fixes #820