Cleaned up warnings.
Allow the chaining of method calls based on promise results.
Use NSUInteger instead of int (silence warnings)