Fix #2740: we were missing the free variables on some expressions