Fix bug where tests for nice fails

This issue is caused by the current thread being used instead of the thread
that is passed to the function. After this fix, passes all 27 tests.