Fix TypeError for external resolved files, fix #42