Fix a bug reported by Ian
Merge branch 'master' into gh-pages