Ensure proper kernel sorting