Removed the locking around the state key. Also fixed the result key update. Finally, fixed the update code for both tables.