Fix onExtend callback and Test Class