Fixed some typos and minor errors, also put in a real error message.