Fixes for new upload code