Add tests and mutexes