Add activities to vendor + small corrections

Is this correct?  You are sending a vendorid to the getAccountName function which will fail. No?
You can use the function getEntityName() to get the name of the vendor.