Mutex -> RWMutex. Fixed mutex and partial template logic.