Avoid predefining function as var which in some cases will cause an error. Closes GH-25.