Commit before changing approaches.

For some reason, using stringstream to write into an unsigned doesn't
work in dce. Save the current state and rewrite without stringstream.
Clean up.