Fixed a bug
fixed test cases