Minor speed/memory/formatting improvements