The GetFormula() and GetSpacedFormula() code do not properly consider, e.g. 13C or 15N or other non-hydrogen isotopes and also needs to add support for total charge, e.g.:
[C2H3O2]- for acetate ion
-Geoff