Fixed some run time errors.