Various fixes, and a build script!