fix bug with --autosave when # of passwords > 2^31

also, fix a minor bug in unit tests