Moved variable declaration to avoid warning.
Cleaned up analyzer warnings.