fix bugs caused by code refactor

moving write_config from the main executable into the library
caused a few naming issues