Fix sprite duration calculation