Fix some mapping (and syntax) errors
Corrections for Lock behavior and some reordering