Fixed some errors in using or referring to release_thread().