Fixed some pretty damn severe errors.