Lock tracing, fixes