Added some debug output. When SN with bad r curve prints indices i and j.