Add NULL support for locked.