Code style fixes

Local variables are lower-case and start with an underscore, global
variables are upper-case.

Signed-off-by: Andrew Tselischev <andrewtselischev@gmail.com>