Add error checking and more precise regexp

Added check for beginning of line on each regular expression. Also added error checking for the ovs-vsctl command and to ensure the TYPE was set correctly.