Fix issue with '<reference path='file.ts'/>

'.ts' file with '<reference path...>'  was assigned wrong compiled Javascript.
This commit fix this, so referencing other '.ts' works now.