Some work on analysis

Minor adjustments to main, notable lowercase'ing horse name and closing
DB connection.