Fix crash in case of creating error node as first node