Fixes a bunch of things