Fix bug with unspecified parentid