Made fixed_dim_from_array recursive and implemented testing for it