many var bugs
Merge pull request #81 from saulelis/bugfixes

many var bugs