Fixed bug with varnames vector, where the names were in the wrong order. We did not respect the order that function arguments were listed in the code, which caused problems with keyword arguments.