Fixed some unnecessary code