Fix a bunch of bugs I added