Added some checks for handling the repo cloning.