fixed glitches with command-line version