Adding self-loops for #903