Fix variable issues