     invoke: (expression)->
       expression = _ImplicitMultiplication.build().onNeitherOperatorNorNumber(expression)
       last = expression.last()
-      if last instanceof Number
+      if last && last.isNumber()
         new_last = last.concatenate(@val)
         expression.cloneAndReplaceLast(new_last)
       else


  class ExponentiationCommand
    invoke: (expression)->
      expression.cloneAndAppend(Exponentiation.build())

  class_mixer(ExponentiationCommand)

  class MultiplicationCommand
    invoke: (expression)->
      expression.cloneAndAppend(Multiplication.build())
  class_mixer(MultiplicationCommand)

  class AdditionCommand
    invoke: (expression)->
      expression.cloneAndAppend(Addition.build())
  class_mixer(AdditionCommand)


  class SubtractionCommand
    invoke: (expression)->
      expression.cloneAndAppend(Subtraction.build())
  class_mixer(SubtractionCommand)

  class NegationCommand

        expression

  class_mixer(_ImplicitMultiplication)

  class _OverrideIfOperatorOrAppend
    initialize: (@expression)->
    with: (operator)->
      last = @expression.last()
      if last && last.isOperator()
        @expression.cloneAndReplaceLast(operator)
      else
        @expression.cloneAndAppend(operator)
  class_mixer(_OverrideIfOperatorOrAppend)

  class PiCommand
    invoke: (expression)->
