Fix compatibility with old databases (#7)
Better debug messages