Fix var scope issue. Grrr.