TypeScript works now
Reworked type chain handling