Fixed bug with insertion

Needed to use the id of the person, not the party and needed to exclude
blank entries