Fix error messages; fix uninitialized value bug.