Fixed a possible OOM issue.