[BK] #Tech - tidied up code and fixed a couple of bugs related to animations.