Fixed unit test and new deprecated warning.