Fix issue #271 and add a test.
Fix signature of ArrayList.ToArray