Fix bugs in code transformation (dependency resolving code)