Function as_tensor expected in the definition of a scalar

That was exactly it. Thanks for the help!