added type checks and checks for valid id/function references in passed labels/validation objects. Also made id var name consistent across labels and valiation loops