Memoryleak

The memoryleak branch is now memory stable, and should be merged into master