Added a fix for d_lock, more to follow...