I think this is too much code; the reason there is a problem is because there wasn't an "addterm" to split into addre and addim and/or m. Handling those cases should allow the line you deleted to work properly, perhaps. Are there cases there there is a non-trivial addre and addim for which the code you added is necessary?