Fix bug with nested resources