Fixes for -Wdeclaration-after-statement
More fixes for -Wdeclaration-after-statement
Patched to compile on Darwin
Fix a couple of warnings