Remove unused variables
General fixes of bad code
Add missing returns
Fix a language code