Fixed empty variable detection