Added the ability to detect finished animations. (+fixed compiler warnings)