Fixed error in handling animated tiles