Many nylon string sets that I buy have treble strings that are of uneven density along their length, and end up playing either a little sharp or a little flat on the higher frets. This happens most often with the third string. There is a trick for fixing this that I learned a long time ago that works pretty well. It can be used also when the string is okay but the guitar is not intonated well (either through bad bridge alignment or fret placement).

The first step is to find out which half of the string needs to be adjusted. This is done by comparing the octave note (at the twelfth fret) with the harmonic at the same fret.

If the harmonic note at the 12th fret is lower than the fretted note, grip the string with all four fingers and rub it vigorously back and forth between the twelfth fret and the nut until it gets hot. This will actually generate enough friction to burn your hand, so be careful. Try playing the fretted note and harmonic again. They should be closer together now (the string will probably also need to be tuned up slightly - it would have gone slightly flat in the process). What has happened is that you heated the string between the nut and the 12th fret and caused it to stretch thinner on that half of its length. This put more string mass on the other half of its length, thereby lowering the pitches played on the higher frets.

If the 12th fret harmonic is higher than the fretted note at the 12th fret, rub the string between the 12th fret and the bridge in the same manner. If one or the other method improved the situation but didn't fix it completely, try taking the string off, swapping the ends, and putting it back on again.