Lock: Fixed the tryReadLock cas loop and val building.