Incorrect precedence when saving notebook as Wolfram language package

I want to save a notebook as a Wolfram language package. When I use the menu command File>Save As and choose ".wl" then the resulting package contains precedence issues which were not there in the original notebook file. For example, a code which is correctly interpreted as (a^2).b in the notebook becomes (a^2.)*b in the package.

Example: A notebook which calculates (a^2).b

nb=CreateDocument[]; NotebookWrite[nb,Cell[BoxData[RowBox[{SuperscriptBox["a","2"],".","b"}]],"Code"]] 

Use File>Save As and choose Wolfram language package. Resulting package looks as follows:

(* ::Package:: *)  a^2.b 

This package evaluates (a^2.)*b instead of (a^2).b.

Is there a possibility to save a notebook as a Wolfram language package preserving correct precedence?