To make sure you don't thread the cog on crooked, start by resting it atop the hub and turning the wrong way (counter-clockwise, as though you were unscrewing it), very slowly. Within one revolution, you will feel the cog pop down into the threads as though it got to a comfortable place where it wanted to be. Stop there and start tightening. You can do the same thing with the lockring, but remember that it threads the other way, so start by turning it clockwise till you feel it get to the happy place.