fix unknown vars and extends