Fixed a typing mistake as well as removed a bit more unneeded code