fix lock checking
Merge branch 'master' into mapdb2