Cleaned up some code, made lock smaller.