Look where you want to go.
It really really sounds like you're looking at the ground - the bike behavior you're describing is what happens when you look at the ground. Looking at the ground is the best way to wind up on it.
*Glance* at the ground well ahead of you - 30-40 feet ahead - to make sure it's clear of gravel, potholes, oil, etc. - then pick your eyes back up (which won't be picking them up that much higher, since you're looking well ahead of time, so as to be prepared when you get there).
Also, stopping/leaning is a great place to countersteer. Turn the handlebars slightly *away* from the foot you're putting down. That induces the bike to lean toward that foot.
Speed comes from what you put behind you. - Judi Ketteler