Fixed the last of the bugs