Error in arguments to refine