Fix for issue #3216.

This fixes issue #3216