added better type/unit match checking in units