Improve alignment heuristic.
Create output directory.