Fixing a few crashes

Fix a couple crashes when submitting funky data.