Error handling for unknown functions and incorrect arity.

@syamp