Fix thread injection bug, work on new API