A few bugfixes (history, db, tools, mvc)