really thanks for sharing with us this tip... this will help for those using cameras like nikon d40 with non AI lens like 50mm f1.8...really appreciate it.
suggest you work with a higher f-number - f4 perhaps.... then more of your subject will be in focus. also check you lens for front/back focusing issues.
move forward/backward till it stabilizes when you're flickering.. sometimes turning the ring you might be working at fine tuning of focus by the centimetres.. will be easier to move forward/backward instead of trying to turn the focus ring by half a millimetre