Resubmitting fix for issue #1312