fix typos in locking, streamline and fix vn_writechk