Found segment fault bug - thread is causing it.