Controlling liquid crystal defects