mtv: improve header check and avoid division by zero