Added encoding check to avoid some errors with older entries