BUGFIX: 500 error on some invalid uploads