Several Typescript definition fixes