Fix bug using replaceOptAln

Fix from todays debugging.

Feel free to rebase or fast-forward rather than doing a full GH merge for this small change.