Remove unused field.
Fix warning about self assignment.
Fix -Wcovered-switch-default warnings.