Fixes to refraction.