Fixed typos and minor conistency issues

1 typo
2 missing braces
Made var usage consistent