Add DHCP support and fix bugs.