Fixed bugs, removed old files