BUGFIX: Fix variable ID validation method.

Same bug as with the switch ID validation method (commit 04b407f).