Fix test cases and removed some deprecated methods