Fix parsing of extends