fixes #855, #827, #858
fixes #855, #827, #858