Better error messages for files upload
Fix compiler warning