Changed duration calculation to work better with short files