Fixed memory leaks.
Removed unessary library links.
Added more objects.
Fixed crashed removed unused code causing segfault.