Adding fixes for errors in depth calculation and sibling errors