Made tagquant more tolerant of large memory usages