xorrect handling of factors in nth. closes #509