Fix a bunch of breaking issues and design flaws