bugfix: the lock() method accepted nil keys silently.