Fix and rearrange a bunch of stuff