Added missing lock

* Added missing upgrade to WriteLock
* Reverted InsertSorted optimisation, it had no effect