Fixed issue with undefined variable being passed in as the context.