Fix call stack too deep issue.