Fixing memory leaks
Merge remote-tracking branch 'markuskobler/master'