File uploading fixes