bug-fixes to cleaning process

- get_all returns indexed array of associate arrays, not
  a simple indexed array
- replace missing rank counter