Sort keys by age when printing them. Also fix a generics warning.