Fix bug in differentiate; "1" should be "(const 1)", for example.