Fixed a few bugs.
Testing mutexes.