[#561] Various fixes