Improved logging even more
Fixed massive memory leak
Fixed minor bugs