Actually, the registry behaved correctly. The problem was the incorrect increment of the index, thus it was a programming (logic) error.
_________________________
There are two types of vessels, submarines and targets.