Fix branch variables in message search mode