Debug Info: Move the sorting and uniqueing of pieces from emitLocPieces()