Handle variable syntax more accurately