Fix bug where existence check was looking at the wrong table.

Similar to others.