Fix REST upload issues