Fix testcase and warnings