Fixes for file upload