Fix type names
Various typo fixes
Reverting unnecessary change in scope of opt.