fixed reading of files and use of -q