Fixed submission error handling and broken tests