Fixes #1170 - PIN issues during upgrade

Fixes #1170
Fixes #1174 online.php unknown location when viewing post
Fixes #1170 - PIN issues during upgrade
Merge pull request #1176 from Stefan-ST/fix-1174

Fixes #1174 online.php unknown location when viewing post
Merge pull request #1172 from ATofighi/patch-2

Fixes #1170 - PIN issues during upgrade
Minor fixes
Minor fixes