Improve variable detection in checkvariables.php