Improved lock tests.