3.0 build fixes

Fix a bunch of build warnings/errors.