Added some testcases and fixed them