Fix uploading to subdirectories