Added array casting to Elementwise and Aggregation like operations.

Fixes #82.
The logic would be clearer with an `elif` here.