Bunch of bugfixes. Also, added a few options in the configuration file
Added a few missing files