bugfixing to merge

Kevin,

Can you merge these fixes?

Cheers
GH