Corrected isValid to not crash and check kar header properly