Fixed #286: Dropping a self edge no more fails

Also added the related unit test.