Partial revert build system. Fix errors.