Fix minor bug when matching var with a given value