A little cleanup, and an attempt to fix the mass open issue (bug?).