More bug fixes on upload