Clean up some array operations.