Fixes for file uploading