Logical errors in test cases fixed.