Fix for Mantis 1214 from Andrew Plotkin
Merge branch 'davidk'