Fix device level tests & lock-check ioctl.