Fixed animation ending logic on anim function, also added some tests to ensure transition values