Fix references with types and inline definitions