Fixed refine errors.