Fix assertion if depth==0