Fixed typos, removed some unneeded code