Fix encoding uncommon types