fix a bunch of compiler errors