Fix return codes and change format of project builder factory.