Fixes for race conditions between threads attempting to index at the same time.