Added more test cases
Fixed wrong error reports