Improve literal serialization