Improved function invocations and error handling / exceptions.