Bugfixes and some destructors. Probable pointer errors in deallocation.