Fix some run-time errors.