Fix for #212: CSymPy simplification error

Can you explain why these changes are needed here? Is it just rearrangement of the if statements? I.e. is this just refactoring or is this introducing some new features? It looks like your code is simpler, so I like it, but it might affect the benchmarks, so we need to be careful and rather submit a separate PR for this.