Finally! Fixes a bunch of stuff