Bug fixes: #801, #804, #845, #846, #852, #853, #854, #855, #856, #858