Fixed bug in alignment simulation.