tridentfb: improve check_var function