Backporting reflection changes and file upload fixes.