Properly detect variable presence