Fix frame traversal while searching for error function.