Fix two level extends requires

When there are intermediate extends recursive requires are not working properly.