Fixed some bugs and added more options in the config