Practically fixed the bugs