Handle null parent in {next,prev}_sibling