fixes wrt to more complex doc structures