Lots of fixes. The mutex is passed.