Multiple target analysis always cause crash

fixed a few issues but the problem is still there. Seems like a memory
issue since every time it crashes at different function calls. Tried
Valgrind with no luck (cannot start). Need to examine the code further.