Added animation support and fixed some mistakes.