Added sanity check.
Added test for sanity check.