Fix some NPE and exceptions that aren't real errors.