Fixed the -a option

Now -a does not add a line if the configuration option already exists.
Added a test for this too.
Minor changes