Fixed crash when calling functions with wrong number of arguments.
Fixed incorrect error messages on bad input