Fixed some potential errors.