 
   exec: (ctx) ->
     args = @execArgs(ctx)
-    if (args.some (x) -> not x?)
+    if (not args? || args.some (x) -> not x?)
       null
     else
       args.reduce (x,y) ->

    super

  exec: (ctx) ->
   args = @execArgs(ctx)
   if (args?.some (x) -> not x?)
    null
   else
    args?.reduce (x,y) ->
      if x.constructor.name == 'Quantity'
        Quantity.doDivision(x,y)
      else
        x / y

module.exports.TruncatedDivide = class TruncatedDivide extends  Expression
  constructor: (json) ->
    super

  exec: (ctx) ->
    Math.floor( @execArgs(ctx).reduce (x,y) -> x / y)

module.exports.Modulo = class Modulo extends  Expression
  constructor: (json) ->
    super

  exec: (ctx) ->
    @execArgs(ctx).reduce (x,y) -> x % y

module.exports.Ceiling = class Ceiling extends  Expression
  constructor: (json) ->
    super

  exec: (ctx) ->
    Math.ceil @execArgs(ctx)

module.exports.Floor = class Floor extends  Expression
  constructor: (json) ->
    super

  exec: (ctx) ->
    Math.floor @execArgs(ctx)

module.exports.Truncate = class Truncate extends Floor



  exec: (ctx) ->
    args = @execArgs(ctx)
    if (not args? || args.some (x) -> not x?)
      null
    else
      args?.reduce (x,y) ->
