Fix PR 720

Hi Stephen,

this is the change to the code that I would suggest based on the discussion today.

I have not tested it so far.

Michael