fix -g add

and start adding some test-cases for global config