I gave all the contacts a cleaning with a pencil eraser, but it still flickers. Isn't it likely that the problem is somewhere in the tail switch, in an area you can't get to with an eraser? The battery contact plate in the tail has to make contact with the tail body, somehow. Those contacts are internal to the tail switch.
People have had similar problems with the tail sw. in the Dorcy AAA. One suggestion there was to use the lanyard hanger to spin the tail sw. internals while the light was activated.