Add safety against corrupt databases
Make sure entities in title get encoded properly
Fix some QF strict notices