Add var to undeclared variables and a function wrapper
merged #119, #131
Merge branch 'ec1980-master'