Fix bug in pins helper