Fixed concurrency issue.
Added a hideous amount of debug.