Lock tracking code fixed for MSVS.