
975 A.2d 357 (2009)
187 Md. App. 101
Raymond LAWSON
v.
STATE of Maryland.
No. 2217, September Term, 2008.
Court of Special Appeals of Maryland.
July 7, 2009.
Brian M. Saccenti (Geraldine K. Sweeney, Public Defenders Office, on the brief), Baltimore, for Appellant.
Robert Taylor, Jr. (Douglas Gansler, Office of the Atty. Gen., on the brief), Baltimore, for Appellee.
Panel: DEBORAH S. EYLER, MATRICCIANI and CHARLES E. MOYLAN, JR. (Retired, Specially Assigned), JJ.
DEBORAH S. EYLER, Judge.
In the Circuit Court for Baltimore City, Raymond Lawson, the appellant, pleaded guilty as part of a plea agreement to possessing a cell phone in his prison cell at the Metropolitan Transition Center. Pursuant to the agreement, the court sentenced him to one year in prison to run consecutive to the completion of any outstanding Maryland sentence not yet fully served.
*358 The commitment record issued by the court clerk after the sentencing included a seven month and two day credit for time the appellant had served awaiting trial on the cell phone charge, even though the appellant had been in prison during that time as the result of prior convictions. The State moved to have the commitment record corrected. After a hearing, the court granted that motion. The appellant promptly filed a motion to correct illegal sentence, alleging that the removal of the credited time resulted in an illegal sentence. The court denied that motion, and this appeal followed.
The appellant poses one question for our review, which we rephrase as follows:
Did the circuit court err in changing his commitment record after sentencing to eliminate the credit for time served?
For the following reasons, we shall affirm the circuit court's order.

STATEMENT OF FACTS
The appellant was incarcerated at the Metropolitan Transition Center in Baltimore City while serving time on two ten-year sentences imposed in Howard County for 2002 convictions for robbery with a dangerous weapon and first-degree assault. On December 18, 2007, the appellant was found to be in possession of a cell phone and other items of contraband in his prison cell. In the Circuit Court for Baltimore City, he was charged with violating Md.Code (2002, 2007 Supp.), section 9-412(a)(3) of the Criminal Law Article ("CL"), which prohibits a person in confinement from knowingly possessing contraband ("the cell phone charge"). After negotiations with the State, he agreed to plead guilty to this charge in exchange for a sentence of one year, to be served consecutive to the last sentence to expire of all his outstanding and unserved Maryland sentences.
On October 8, 2008, the appellant appeared before the circuit court and entered his guilty plea. The judge pronounced the sentence as follows: "The Court having found the defendant guilty of possession of contraband, specifically a cell phone, does impose a sentence of one year. That sentence will be served consecutive to any other Maryland sentence."
After the sentence was pronounced, the court clerk issued a "commitment record" documenting that the appellant had been sentenced to one year "consecutive to all outstanding & unserved MD sent." In doing so, the court clerk checked the box on the commitment record that reads "consecutive to the last sentence to expire of all outstanding and unserved Maryland sentences." The court clerk also wrote on the commitment record, however, that the appellant was to receive seven months and 12 days credit for time served awaiting trial on the cell phone charge. In fact, this credit was neither part of the plea agreement nor part of the sentence imposed by the judge in open court.
On October 9, 2008, the State filed a motion to correct commitment record, seeking to have the court enter a commitment record correctly spelling out the plea agreement and the court's sentence. The correction would remove the time erroneously credited to the appellant on the original commitment order.
The sentencing court held a hearing on the State's motion on October 29, 2008. Defense counsel acknowledged that the sentence announced in open court was "one year consecutive to any other Maryland sentence being served," and that the only issue before the court was whether the entry of the credit by the court clerk was correct. Defense counsel nevertheless argued that the appellant was entitled to the credit under Md.Code (2001, 2008 *359 Repl. Vol.), section 6-218(b)(1) of the Criminal Procedure Article ("CP"), and that, even if he were not entitled to the credit, the sentencing court properly could not remove the credit after the fact, as that would result in an impermissible increase in sentence under Rule 4-345. The sentencing court granted the State's motion and a new commitment record was issued without the credit for time served.
Later that same day, the appellant filed a motion to correct illegal sentence, asserting that the removal of the credit had rendered his sentence illegal. On November 10, 2008, the sentencing court denied that motion. It concluded that the appellant's argument was based upon an "unreasonable interpretation and senseless application of [CP section 6-218], which, if adopted by this court, would leave this court powerless to impose any meaningful penalty upon an inmate for subsequent crimes that carry a sentence less than their current sentence for which they are incarcerated."

DISCUSSION
The appellant contends that credit for time served awaiting trial is mandatory under CP section 6-218(b)(1), and thus the court's subsequent removal of the credited time from his original commitment record made his sentence illegal. See Smith v. State, 31 Md.App. 310, 317, 356 A.2d 320 (1976) (holding that sentence was illegal when court failed to apply credit mandated by statute). According to the appellant, while he was incarcerated for his 2002 convictions, he was served with an arrest warrant for the cell phone charge; and, as he was not released on his own recognizance or on bail while that charge was pending, he was entitled to credit against any sentence imposed on that charge for time served, under CP section 6-218(b)(1).
CP section 6-218, entitled "Credit against sentence for time spent in custody," provides, in pertinent part:
(b)(1) A defendant who is convicted and sentenced shall receive credit against and a reduction of the term of a definite or life sentence, or the minimum and maximum terms of an indeterminate sentence, for all time spent in the custody of a correctional facility ... because of:
(i) the charge for which the sentence is imposed; or
(ii) the conduct on which the charge is based.
(2) If a defendant is in custody because of a charge that results in a dismissal or acquittal, the time that would have been credited if a sentence had been imposed shall be credited against any sentence that is based on a charge for which a warrant or commitment was filed during that custody.
(3) In a case other than a case described in paragraph (2) of this subsection, the sentencing court may apply credit against a sentence for time spent in custody for another charge or crime.
The standard of review for interpretation of a statute is de novo. Blickenstaff v. State, 393 Md. 680, 683, 904 A.2d 443 (2006). As the Court of Appeals has explained with reference to the statute at issue here:
The construction of Sections 6-218(b)(2) and (b)(3) of the Criminal Procedure Article implicate a de novo review. Our goal, when interpreting statutes, is to identify and effectuate the legislative intent underlying the statute(s) at issue. The best source of legislative intent is the statute's plain language, and when the language is clear and unambiguous, our inquiry ordinarily ends there. When there is more than one reasonable interpretation of a statute, *360 however, the statute is ambiguous. When the statutory language is ambiguous, we resolve that ambiguity in light of the legislative intent, considering the legislative history, case law, and statutory purpose. We consider not only the ordinary meaning of the words, but also how that language relates to the overall meaning, setting, and purpose of the act. The statute's provisions must be read in a commonsensical perspective to avoid a farfetched interpretation. We construe the statute as a whole so that no word, clause, sentence, or phrase is rendered surplusage, superfluous, meaningless, or nugatory.
Gilmer v. State, 389 Md. 656, 662-63, 887 A.2d 549 (2005) (citations omitted) (emphasis added) (internal quotation marks omitted).
The crux of the appellant's argument is that "[n]othing in the language of [CP section] 6-218 indicates that the charge or conduct for which a defendant is being sentenced must be the sole cause of his pretrial detention, and the rule of lenity counsels against such a restrictive meaning."
CP section 6-218(b)(1) is not ambiguous, and so the rule of lenity does not apply. Tribbitt v. State, 403 Md. 638, 646, 943 A.2d 1260 (2008); Jones v. State, 336 Md. 255, 261, 647 A.2d 1204 (1994). The statute's plain meaning is that, upon conviction, a defendant must be credited for time he has served in custody "because of" that crime (or the conduct underlying that crime). Here, prior to his cell phone charge conviction, the appellant was serving time in custody for his 2002 convictions, not for the cell phone charge (or for possessing a cell phone in prison). If the appellant never had been charged with illegal possession of the cell phone, he nevertheless would have spent that entire seven months and 12 days in prison because of his 2002 convictions. (In fact, if he never had possessed the cell phone, he still would have spent that time in prison.) Cf. Blankenship v. State, 135 Md.App. 615, 620, 763 A.2d 741 (2000) (holding that, when a defendant is held to answer for numerous charges, he is not entitled to have his jail time credit multiplied by being given credit on each sentence for the full time he spends in jail awaiting disposition on multiple charges of cases). Under the plain meaning of CP section 6-218(b)(1), the appellant was not entitled to be credited for time served, because there was no time served.
The appellant argues in the alternative that, even if he was not entitled to credit for time served under CP section 6-218(b)(1), the inclusion of the credit on his original commitment record shows that the sentencing judge exercised his discretion to grant him credit for time served, under CP section 6-218(b)(3); and, having exercised his discretion to grant the credit, or even if the commitment record was in error, the sentencing judge could not correct the sentence, after the appellant left the sentencing hearing, so as to increase the time the appellant would serve.
The record in this case makes plain that credit for time served was not part of the plea agreement and was not part of the sentence as pronounced by the court. Neither was credit for time served part of the plea agreement presented by counsel to the court. The hearing transcript is clear that the sentence pronounced was one year, to be served consecutive to any other outstanding Maryland sentence. There was no mention at the hearing of any credit for time served; and, if the court were granting such a credit, it would have been required to tell the appellant and state on the record "the amount of the credit and the facts on which the credit is based." CP § 6-218(e)(2).
*361 The appellant relies upon the original commitment record and the docket entries as proof that the sentencing court intended to grant the credit. "When there is a conflict between the transcript and the commitment record, unless it is shown that the transcript is in error, the transcript prevails." Douglas v. State, 130 Md.App. 666, 673, 747 A.2d 752 (2000); see also Dutton v. State, 160 Md.App. 180, 191-92, 862 A.2d 1075 (2004). A similar rule applies to docket entries. Dedo v. State, 105 Md.App. 438, 462, 660 A.2d 959 (1995) ("[W]e direct the circuit court to amend the docket entries and commitment record to reflect the two-year sentence indicated in the sentencing transcript."), rev'd on other grounds, 343 Md. 2, 680 A.2d 464 (1996); Shade v. State, 18 Md.App. 407, 411, 306 A.2d 560 (1973) ("The transcript of the trial, unless shown to be in error, takes precedence over the docket entries[.]"); Williams v. State, 7 Md.App. 241, 245, 254 A.2d 376 (1969) ("Since, however, the transcript shows that the docket entry was erroneously entered, we will remand the case for correction of the docket entry [.]"). See also Coleman v. State, 231 Md. 220, 222-23, 189 A.2d 616 (1963) (case remanded for correction of docket entry). There has been no showing or allegation that the transcript is in error. Thus, we must conclude that no credit ever was given or intended as part of the appellant's sentence.[1]
Finally, the appellant argues that, regardless of the court's intentions, once the sentencing court granted the credit as reflected in the commitment record, and the appellant had left the courtroom, the court no longer had the power to remove the credit. Md. Rule 4-345(c).[2] The appellant is incorrect. Rule 4-345 applies only when the court intends to make changes to a pronounced sentence. As explained above, the credit reflected in the appellant's original commitment record never was part of the sentence pronounced in this case, a fact established by the transcript. Therefore, when the sentencing court granted the State's motion to correct the commitment record and issued a corrected commitment record, Rule 4-345 did not apply; rather, Rule 4-351,[3] regarding *362 commitment records, governed. Scott v. State, 379 Md. 170, 190-91, 840 A.2d 715 (2004). Stated differently, Rule 4-345 applies to sentence modifications. The credit at issue here was never part of the sentence. Thus, correcting the commitment record to remove the credit was not a modification of the sentence, and Rule 4-345 did not apply. Moreover, the sentence was not increased by correcting the commitment record to remove the credit for time served because the credit had not been given, and was not required to be given, to begin with.
ORDER AFFIRMED. COSTS TO BE PAID BY THE APPELLANT.
NOTES
[1]  The appellant also asserts that "defense counsel informed his client on the record in open court, and presumably within the hearing of the judge, that he had been awarded credit against this sentence." The transcript shows that counsel was responding to a question put to him by his client, which happened to be transcribed. We will not speculate as to whether the judge did or did not hear counsel's communication with his client, or what would be an appropriate response if he had.
[2]  Rule 4-345 states in relevant part:

(a) Illegal Sentence. The court may correct an illegal sentence at any time.
(b) Fraud, Mistake, or Irregularity. The court has revisory power over a sentence in case of fraud, mistake, or irregularity.
(c) Correction of Mistake in Announcement. The court may correct an evident mistake in the announcement of a sentence if the correction is made on the record before the defendant leaves the courtroom following the sentencing proceeding....
[3]  Rule 4-351 provides:

(a) Content. When a person is convicted of an offense and sentenced to imprisonment, the clerk shall deliver to the officer into whose custody the defendant has been placed a commitment record containing:
(1) The name and date of birth of the defendant;
(2) The docket reference of the action and the name of the sentencing judge;
(3) The offense and each count for which the defendant was sentenced;
(4) The sentence for each count, the date the sentence was imposed, the date from which the sentence runs, and any credit allowed to the defendant by law;
(5) A statement whether sentences are to run concurrently or consecutively and, if consecutively, when each term is to begin with reference to termination of the preceding term or to any other outstanding or unserved sentence.
(6) the details or a copy of any order or judgment or restitution.
(b) Effect of error. An Omission or error in the commitment record or other failure to comply with this Rule does not invalidate imprisonment after conviction.
