Added order to histories on records, and fixed minor bugs