Fixing various things to make this beast compile again