Fix a melange of problems with the 'build system'.