RFC: Make SetThreadContext work properly