Fixed lexsymbol add algorithm and added test