fixed some typos, thread-lock and stats related trivial issues.