Handling of empty and invalid parent