Changed typos and fixed precondition checks.