Fix test code and delete deprecated assert method.