Fixing distinct branch checking.