Refinement and a bug fix.