Fixed bugs. Scope checks that all forward declarations are defined before exiting