cleanup counter key; tests for array