Fixed mistake in E2 upload code

Fixes #770