Fixes RAM usage problems.