Fix for issue #6870

Added missing checks