Minor changes to support iOS 6 while keeping the API intact

Style: `else` on same line as closing braces.