Use branch tracked remote instead of random

This is useful when working with github fork and upstream.

Also fixed some code styling.