Fixed branch/tag detection