Fix incorrect locks
Fix "assign where" for nested groups

fixes #7475