A method of operating an internal combustion engine comprising at least one cylinder equipped with a pressure sensor, wherein, said engine is operated in an injector learning mode, in which an injection parameter associated with a nominal fuel quantity of a pilot injection is learned based on the following measurement routine: performing a learning pilot injection based on a candidate value for said injection parameter to influence injection of said nominal fuel quantity and determining a parameter indicative of the actually injected fuel quantity based on the in-cylinder pressure during combustion of said learning pilot injection; said learning pilot injection is performed in a predetermined learning window separate to the regular combustion mode and operated at an early timing such as to ensure that combustion thereof is complete before the next combustion starts, and preferably before TDCc; said determination of the parameter indicative of the actually injected fuel quantity based on the in-cylinder pressure takes into account essentially the entire combustion event of said learning pilot injection; wherein each learning pilot injection is calibrated so that essentially the entire combustion thereof occurs within said predetermined learning window before TDCc without other combustion in said learning window; and the measure of the in-cylinder pressure is effected over said learning window; characterized in comprising a preliminary step of measuring the in-cylinder pressure over said predetermined learning window during an engine working cycle without learning pilot injection, in order to determine a starting baseline pressure; and the determination of the parameter indicative of the injected fuel quantity for an actual fuel injection takes into account said starting baseline pressure and comprising a final baseline step of measuring the in-cylinder pressure over said learning window during an engine working cycle without learning pilot injection in order to determine an ending baseline pressure, after said learning pilot injection(s); and wherein the injection parameter is updated or corrected based on a comparison between the parameter indicative of the actually injected fuel quantity and a target threshold or range, only if said starting and ending baseline measurements are substantially similar. said learning pilot injection is performed in a predetermined learning window separate to the regular combustion mode and operated at an early timing such as to ensure that combustion thereof is complete before the next combustion starts, and preferably before TDCc; said determination of the parameter indicative of the actually injected fuel quantity based on the in-cylinder pressure takes into account essentially the entire combustion event of said learning pilot injection; wherein each learning pilot injection is calibrated so that essentially the entire combustion thereof occurs within said predetermined learning window before TDCc without other combustion in said learning window; and the measure of the in-cylinder pressure is effected over said learning window; characterized in comprising a preliminary step of measuring the in-cylinder pressure over said predetermined learning window during an engine working cycle without learning pilot injection, in order to determine a starting baseline pressure; and the determination of the parameter indicative of the injected fuel quantity for an actual fuel injection takes into account said starting baseline pressure and comprising a final baseline step of measuring the in-cylinder pressure over said learning window during an engine working cycle without learning pilot injection in order to determine an ending baseline pressure, after said learning pilot injection(s); and wherein the injection parameter is updated or corrected based on a comparison between the parameter indicative of the actually injected fuel quantity and a target threshold or range, only if said starting and ending baseline measurements are substantially similar.