Corrected scoring by considering only valid bytes