fixing the stride computation case and adding test cases for issue #2196