Fixed a few bugs related to alignment sampling.