Fixes issue 1712 as fixed by cromwellryan