Fixed a test issue with subarray and diag; improved subarray argument handling and documentation