Added better preview handling and branch config.