Fix typo in random build function and add new function BuildIfNotRC