Fix crash at graph build time