Lots of bugfixes, looking pretty good for now