Fixed some screwed up code