Fix various element related to threads