Fix security exception issues that could arise after validation had failed because of the entityType changing on the form