CreateThread->NewThread & p_thread & scanhash fixes