Fixed invalid state exception from CompilationUnit.