Right curly braces beginning of line and statements' curly braces fix

A pull request with reference to GCI-9 task.
Fixed major issue Right curly braces should be located at the beginning of lines of code.
This is accomplished after hours of annoying work with git.
Thanks to dkayiwa and harsha89 for the help.
I think you missed the } else { here. Make sure that won't happen next time :)