neutral refactorings to silence Xcode 4.5.2 warnings

These changes silence compiler warnings by fixing small bugs or clarifying the code to help the static analyzer.

Fixes:
- initialized some function local variable at their declaration
- corrected a NSLog format specifier

hints:
- use standard Obj-C idiom to initialize ivars
- rename  local vars so they don't shadow vars from the enclosing scope
- enhance conditional to silence warning about div-by-zero