Fixes dead store and uses NSData instead of malloc/free
Fixes memory leak
Fixes some format strings
Fixes some int <-> unsigned long conversions
Merge pull request #180 from Jaxan/analyzer-issues

Analyzer issues