Fix bug in lattice tagging