Optimistic locks fixes - lock type is changed
Merge branch 'master' into stable