Add build code and clean up errors