Added some tests for r/w mode in arrays so as to avoid regressions