Fix for bug where no hints were displayed if there were no associations.

Also improved sorting for the hints from the basetype - they are now sorted in lexicographic order.