Modified check to test size of flattened value of a variable.

- Add on to previous pull request for this branch. Used `get_flattened_value` for checking the size of a variable.