Fixed a bunch of typos etc.  Also got rid of mutexes in favor of a local variable