Fixed error checking when checking valid repository