Fixed testcase & a bug

Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>