Threading improvements, comments
Additional locking