I like to hold down my left mouse button majority of the time to control my camera and have noticed that occasionally depending on where my mouse cursor actually is, that can cause it to change my target or clear it completely. Happens fairly rarely, though if you are saying that your target is not actually changing... that sounds like a bug.