Fixed bug with average frame delay calculation