Fix animation bug and add unit tests again.