Fixed typos and minor consistency issues

1 typo
2 missing braces
Made var usage consistent