WIP: many fixes