Added tests and supported multidimensional return values.