Fix a bunch of problems with build