Some more TS fixes (DO NOT MERGE)