Minor fixes to var handling.