Did quick cleanup of code, fixed Analyze issues