Fixed few bugs present when called with -s -a.