Fixed bug with duplicated entry.

As pointed out by Khanh, there were some minor setbacks with the current
relation.