Fixed memory allocation issues when computing SOIL