Bug 1081597: Refactor some branches. r=rnewman
Bug 1081606: Don't call toArray with zero-size arrays. r=rnewman
Bug 1081597 - Refactor some branches. r=rnewman
Bug 1081606 - Don't call toArray with zero-size arrays. r=rnewman