Fix for #680 as provided by @mrmInc