Clean up string-justifying code.

Thanks to @gaspodog!