Fixed typos.

Change-Id: I08ea25ccfebe142539cf4a72fd825311d4100524
Added mutex for concurrent access. Further testing is still needed.

Change-Id: If9b766ee413fcb2dd5c5777a8f25213d083330bf