Fixes a lot of stuff.