Fix the extends bugs.