Fix a segfault when pull action failed because of double deletion

and fix the clone script to not be so strict about branch names