Fix bug in returning parent id, when name of page is used.

Should check for parent id, based on name, before trying to use the
name as an id.