Fixed some memory and threading issues. Should be solid now.