More TypeScript changes. Not working yet.