Fixed bugs and updated unneeded imports