Enhanced Xcode tests for branches.

Fix tests.
Fixed bug in calculation of branch rates.