As you're learning your pieces, take time to soak them up correctly and thoroughly. Like a new-born duck, you are imprinting the song on your brain the first times you play it and hear it, so be sure you learn it right in the beginning. Take your time and make sure you've got it right. It'll be harder to even notice places that sound correct but are actually not right as time goes by, so go slowly in the beginning, especially for classical songs (because with most pop songs, you're listening to the original frequently). Next, as you are working on the song, be aware ofperformance demand, the pressure during any performance to just get through the song in one piece, abandoning artistry, dynamics, articulations, emotion - all the things that make music out of what you're doing. Pressure during performance will squeeze the life out of your song - in this case I don't mean nervousness per se, rather the imperative to simply get from beginning to end and hang the details. But it's those details that make your music wonderful. So press back against performance demand and hold onto and develop the uniqueness of your songs.
Christopher Parkening has said play a passage perfectly 7 times before considering it mastered. I don't know if it has to be 7, but it's close.