Add and remove pins

Actually I realized it works as expected on this one!
The weird bug must have come from somewhere else. We'll keep that for the next pull request.