Fixed bugs after first run.