Proper branch name validation, fixes #272