Fixing support for tags as well as branches.