File upload fixes