fixed some small var bugs