Final fixes so it actually compiles