Small fixes for file upload