Fixed a bunch of stuff the compiler caught