Added fixes for bug #1052. Fixes the problems with animation chaining (and problems...