Remove function names from error messages. Finish #5031