Merging Dan's latest changes. Update build script.