Fix empty variable detection