Added log files for debug. Lesser bugs fixed