Added array-element capture test
Fixed style issues in tests
Stylistic changes and cleanups