Added handling of bogus points, and errors.