Fixed a couple of bugs caused by typos