Bugfixes and memory leaks holed