Changed the way the qb_function pointer is stored to deal with inheritance