Lots of backend fixes