Fixed an unbalanced lock in the csi parsing