Rebase and fix most of style warnings
Restore missing braces
Fix all except one warnings
Merge remote-tracking branch 'myltsev/master'