More memoryleak fixes, still very strange behaviour