Initial fixes to the mopac TS implementation