Fixed a warning and removed unnecessary code.