some fixes to prepare for the next version of TypeScript