Fix parsing of bonded molecules within a formula

So now stuff like citric acid ('C3H4OH(COOH)3') is parsed correctly.