added config module and minor bug fixes