Fixed branch detection for prompt