[WIP] Various fixes