Fixed animation bugs

Animations now work properly.