A few things I do. One is keep the walls clean. Another, I put a piece of paper towel over the top of the container and then put the cover on. This does two things. It keeps the worms in and it keeps any outside things from making fruit flies and other things from growing and flying out. It also keeps the smell down a bit.
I now switched to an even better idea. I'm feeding Dubai roaches instead. They LOVE them. No stink, no jumping or climbing out, after they establish a colony, no more buying more bugs, they eat almost anything, they are super nutritious... what more can I ask? Oh, they don't hatch into flies or other nasty stuff and they live from 1-2 years.