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)