semant.cc: Fixed major issues with inheritance logic