sid: Clean up data structures and locking.