Fixed bugs and improved configuration