Fixed some indexing in test_ad_matvar (Issue #2245)
Fixed some indexing in test_ad_matvar (Issue #2245)

stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math