Fix a memoryleak/oom killer issue. Bug number 147.