Fixes #1170 - PIN issues during upgrade

#1170
Merge pull request #1185 from ATofighi/patch-1

Fixes #1170 - PIN issues during upgrade