Fixes #5272 - This is a clone of #5291

#5291 inadvertently reverted by @richard67 - this re-instate its code...
Merge pull request #5328 from smanzi/FixesProtostar

Fixes #5272 - This is a clone of #5291