Cleared up some potential threading issues.