Fixed warnings: comparisons between unsigned and signed integers.
Fixed warning: multiple accesses to weak variable.

Not a huge deal in this case, but it's always a good idea to get a strong reference to the object we only have a weak reference to so that it can't go away half-way through the execution of a block (which in some cases can cause bugs that are super hard to track down)
Fix indentation
Merge pull request #1 from JaviSoto/master

Fixed some warnings