fixed warnings and test cases work